Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
mirror-drive
Advanced tools
Mirror a Hyperdrive or Localdrive into another one
npm i mirror-drive
import MirrorDrive from 'mirror-drive'
const src = new Localdrive('./src')
const dst = new Hyperdrive(store)
const mirror = new MirrorDrive(src, dst)
console.log(mirror.count) // => { files: 0, add: 0, remove: 0, change: 0 }
for await (const diff of mirror) {
console.log(diff) /* {
op: 'add',
key: '/new-file.txt',
bytesRemoved: 0,
bytesAdded: 4
}*/
}
console.log(mirror.count) // => { files: 1, add: 1, remove: 0, change: 0 }
Another example:
const mirror = new MirrorDrive(src, dst)
console.log(mirror.count) // => { files: 0, add: 0, remove: 0, change: 0 }
await mirror.done()
console.log(mirror.count) // => { files: 1, add: 1, remove: 0, change: 0 }
const mirror = new MirrorDrive(src, dst, [options])
Creates a mirror instance to efficiently move src
drive into dst
drive.
Available options
:
{
prefix: '/',
dryRun: false,
prune: true,
includeEquals: false,
filter: (key) => true,
metadataEquals: (srcMetadata, dstMetadata) => { ... }
batch: false,
entries: null // Array of key entries (if you use this then prefix is ignored)
ignore: String || Array // Ignore source files and folders by name.
}
mirror.count
It counts the total files proccessed, added, removed, and changed.
Default value: { files: 0, add: 0, remove: 0, change: 0 }
await mirror.done()
It starts processing all the diffing until is done.
Apache-2.0
FAQs
Mirror a hyperdrive or localdrive into another one
The npm package mirror-drive receives a total of 2,625 weekly downloads. As such, mirror-drive popularity was classified as popular.
We found that mirror-drive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.